package com.vacation.vacationdemo.config;

import com.vacation.vacationdemo.intercept.LoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 杨光
 * @date 2022年03月12日 9:32
 */
//@Configuration
public class VacationConfiguration implements WebMvcConfigurer {

    /*

    @Bean(value = "vacationLoginInteceptor")
    public LoginInterceptor loginInterceptor(){
        return new LoginInterceptor();
    }


    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(loginInterceptor())
                .addPathPatterns("/**")  //拦截哪些路径
                .excludePathPatterns("/vacation/tologin","/vacation/dologin","/js/**","/css/**");//放行哪些路径

        System.out.println("注册完毕");
    }
    */

}
